<template>
  <div class="ma-content-block lg:flex justify-between p-4">
    <!-- CRUD 组件 -->
    <ma-crud :options="options" :columns="columns" ref="crudRef">
    </ma-crud>
  </div>
</template>
<script setup>
import { ref, reactive } from 'vue'
import aiproCategory from '@/api/aipro/aiproCategory'
import { Message } from '@arco-design/web-vue'
import tool from '@/utils/tool'
import * as common from '@/utils/common'

const crudRef = ref()




const options = reactive({
  id: 'aipro_category',
  rowSelection: {
    showCheckedAll: true
  },
  pk: 'id',
  operationColumn: false,
  operationColumnWidth: 160,
  formOption: {
    viewType: 'drawer',
    width: 600
  },
  api: aiproCategory.getList
})

const columns = reactive([
  {
    title: "",
    dataIndex: "id",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    commonRules: {
      required: true,
      message: "请输入"
    }
  },
  {
    title: "标题",
    dataIndex: "title",
    formType: "input",
    search: true,
    commonRules: {
      required: true,
      message: "请输入标题"
    }
  },
  {
    title: "",
    dataIndex: "aipro_id",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true
  },
  {
    title: "图标",
    dataIndex: "icon",
    formType: "input",
    hide: true
  },
  {
    title: "pid",
    dataIndex: "pid",
    formType: "input",
    search: true
  },
  {
    title: "是否默认页",
    dataIndex: "is_default",
    formType: "switch",
    search: true,
    commonRules: {
      required: true,
      message: "请输入是否默认页"
    },
    checkedValue: "1",
    uncheckedValue: "0"
  },
  {
    title: "简介",
    dataIndex: "desc",
    formType: "input",
    search: true
  },
  {
    title: "状态",
    dataIndex: "status",
    formType: "switch",
    search: true,
    checkedValue: "1",
    uncheckedValue: "0"
  },
  {
    title: "排序",
    dataIndex: "sort",
    formType: "input",
    search: true
  },
  {
    title: "",
    dataIndex: "created_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    showTime: true
  },
  {
    title: "",
    dataIndex: "updated_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    showTime: true
  }
])
</script>
<script> export default { name: 'aipro:category' } </script>